
layui.use(['layer','laydate'], function(){
    componentSelectInit(
        {
            ctxPath:'',
            tableName:"wn_farm",
            showValueField:"name",
            valueField:"id",
            selectId:"farmId"  ,
            where:""
        }
        ,function(){
        });
});

var wnFarmlandConsoleGrid =new consoleGrid({table_id:"wnFarmland"});
wnFarmlandConsoleGrid.init();
function wnFarmlandTableOperate(value){
    var width = $(window).width()*0.8;
    var height = $(window).height()*0.8;
return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindowObj({id:\"wnFarmland\",url:\"/console/wn_farmland/edit?id="+value+"\",title:\"编辑\",width:"+width+",height:"+height+"});'><span class='glyphicon glyphicon-pencil'></span></button> ";
}
function wnFarmlandLoadParam(params){
params.query=wnFarmlandQueryString();
return params;
}
function wnFarmlandQueryString() {
var objQuery = new Object();
    objQuery.latlngs=$('#latlngs').val()==''?null:$('#latlngs').val(); 
     objQuery.name=$('#name').val()==''?null:$('#name').val(); 
     objQuery.farmlandNumber=$('#farmlandNumber').val()==''?null:$('#farmlandNumber').val(); 
     objQuery.farmId=$('#farmId').val()==''?null:$('#farmId').val(); 
     objQuery.farmlandArea=$('#farmlandArea').val()==''?null:$('#farmlandArea').val(); 
     objQuery.farmlandAreaGeometric=$('#farmlandAreaGeometric').val()==''?null:$('#farmlandAreaGeometric').val(); 
     objQuery.centerLatlng=$('#centerLatlng').val()==''?null:$('#centerLatlng').val(); 
 
var queryString = JSON.stringify(objQuery);
return queryString;
}

